import { combineReducers } from 'redux';
import { persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';

// Redux Toolkit Slices
import accountSlice from "./accountSlice";
import userSclice from './userSlice' //用户相关的

const rootReducer = combineReducers({
    //   counter: counterSlice.reducer
    accountGroup:accountSlice,
    userSclice:userSclice
});

const persistConfig = {
  key: 'dxer_',
  storage,
  // whitelist: ['accountGroup'] // 指定需要持久化的 reducer 键名:持久化路由
  whitelist:['userSclice']  //持久化了
};

const persistedReducer = persistReducer(persistConfig, rootReducer);

export default persistedReducer;
